#!/bin/bash

. $ZMICRO_HOME/commands/machine/lvm/config

is_lvm_created() {
  sudo vgs | grep $VG_NAME >> /dev/null 2>&1
  if [ "$?" != "0" ]; then
    echo "false"
    return
  fi

  echo "true"
}

list() {
  # sudo pvs
  # pvscan: phical volume scan
  # vgscan: volume group scan
  # lvscan: logic volume scan
  sudo pvscan
}

help() {
  echo "Usage:"
  echo "  zmachine lvm ls"
  echo ""
}

core() {
  if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
    help
    exit 0
  fi

  list
}

run() {
  core $@
}

run $@
